package com.mrd.gtimpframe.scheduler;

import com.mrd.gtimpframe.service.StartRunnerBiz;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Created by dark on 17/8/10.
 */
@Component
public class TimerScheduler {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Resource
    private StartRunnerBiz startRunnerBiz;

    /**
     * 每天凌晨2点执行
     * 更新redis中智能审单中商品编码信息
     */
    @Scheduled(cron = "0 0 2 * * ?")
//    @Scheduled(cron = "0 0/1 * * * ? ")
    public void updateGoodsCodeCache() {
//        logger.info("每分钟执行一次。开始……");
//        logger.info("每分钟执行一次。结束。");
        startRunnerBiz.selectAndUpdateGoodsCodeCache();
    }

}
